<?php
/**
 * @since   2017-11-02
 * @author  zhaoxiang <zhaoxiang051405@gmail.com>
 */

namespace app\model;


class AdminOss extends Base {
    public static function doSave($tid, $data)
    {
        $model = self::get(['tid'=>$tid]);
        if ($model) {
             $model->getData();
            $affected = $model->save($data, ['tid' => $tid]);
            if ($affected) {
                return true;
            } else {
                return false;
            }
        }else{
            $affected = self::create($data);
            if ($affected) {
                return true;
            } else {
                return false;
            }
        }
    }
}
